/**
 * 
 */
package com.fh.controller.expand;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.fh.controller.base.BaseController;
import com.fh.entity.Page;
import com.fh.entity.PlanContent;
import com.fh.service.expand.PlanContentService;
import com.fh.util.Constants;
import com.fh.util.PageData;

/**
 * ClassName: PlanController 
 *
 * @Description TODO
 *
 * @author mouchina1005
 *
 * @date 2017年8月26日 上午2:13:25
 *
 */
@Controller
@RequestMapping(value="/plan")
public class PlanController extends BaseController{

	@Resource PlanContentService planContentService;
	/**
	 * 列表
	 */
	@RequestMapping(value="/list",method = {RequestMethod.GET,RequestMethod.POST})
	public @ResponseBody Object list(Page page){
		logBefore(logger, "列表Event");
		//if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限
		Map<String,Object> map = new HashMap<>();
		ModelAndView mv = this.getModelAndView();
		PageData pd = new PageData();
		try{
			pd = this.getPageData();
			page.setPd(pd);
			List<PlanContent>	varList = planContentService.listAllPlanContent();	//列出Event列表
			mv.setViewName("expand/event/event_list");
			mv.addObject("varList", varList);
//			mv.addObject("pd", pd);
//			mv.addObject(Const.SESSION_QX,this.getHC());	//按钮权限
			map.put("result", Constants.SUCCESS);
			map.put("list", varList);
//			map.put("page", page);
		} catch(Exception e){
			logger.error(e.toString(), e);
			map.put("result", Constants.FAIL);
		}
		return map;
	}
}
